Skip to content

fix: stop analyze.sh from hanging at interactive prompts - #15

Merged
blimmer merged 2 commits into
mainfrom
fix/analyze-sh-tty-hang
May 27, 2026
Merged

fix: stop analyze.sh from hanging at interactive prompts#15
blimmer merged 2 commits into
mainfrom
fix/analyze-sh-tty-hang

Conversation

@blimmer

@blimmer blimmer commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

The analyze.sh installer ran the downloaded binary with < /dev/tty to hand piped curl ... | bash invocations a terminal. But a bun build --compile'd binary cannot read raw-mode keypresses from a freshly-opened /dev/tty fd, so every interactive prompt hung with no way to type, use arrows, or Ctrl-C out — even for the recommended bash -c "$(curl ...)" form, whose stdin was already a working terminal until the redirect replaced it. This drops the redirect and runs with inherited stdin: the command-substitution form works, and the piped form now fails the CLI's TTY gate with a clear "requires a terminal" message (exit 2) instead of hanging.

Review focus

The trade-off worth scrutinizing: this gives up on supporting curl ... | bash entirely. Reconnecting /dev/tty is the only mechanism to give a piped invocation a terminal, and it's exactly what's broken under the compiled Bun binary — so there's no fix that keeps the pipe form interactive. Reproduced under a real pseudo-terminal against the v0.1.0 binary: inherited stdin → Ctrl-C cancels cleanly; < /dev/tty → prompts dead, process must be SIGKILL'd.

Commits

  • c960e3f — drop the /dev/tty redirect; run with inherited stdin and let the TTY gate handle non-terminals

blimmer and others added 2 commits May 27, 2026 08:00
The installer ran the compiled binary with `< /dev/tty` to give piped
`curl ... | bash` invocations a terminal. But a `bun build --compile`'d
binary can't read raw-mode keypresses from a freshly-opened /dev/tty fd,
so every interactive prompt hung with no way to type, arrow, or Ctrl-C
out — even for the recommended `bash -c "$(curl ...)"` form, whose stdin
was already a working terminal before the redirect replaced it.

Run with inherited stdin instead. The command-substitution form keeps a
real terminal on stdin and works; the piped form now fails the CLI's TTY
gate with a clear 'requires a terminal' message (exit 2) instead of
hanging.
@blimmer
blimmer marked this pull request as ready for review May 27, 2026 14:01
@blimmer
blimmer requested a review from jcarver989 as a code owner May 27, 2026 14:01
@blimmer
blimmer merged commit e894145 into main May 27, 2026
7 checks passed
@blimmer
blimmer deleted the fix/analyze-sh-tty-hang branch May 27, 2026 14:04
blimmer pushed a commit that referenced this pull request May 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.1.1](v0.1.0...v0.1.1)
(2026-05-27)


### Bug Fixes

* stop analyze.sh from hanging at interactive prompts
([#15](#15))
([e894145](e894145))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: contextbridge-pr-automation[bot] <259134118+contextbridge-pr-automation[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant